# coding=utf-8

from application import app
import re


def CompileIgnore(path, ignore_urls):
    """
    判断是否忽略登录检查
    :param path:
    :param ignore_urls:
    :return: True 忽略 False 不忽略
    """
    ignore_check_login_urls = app.config["IGNORE_CHECK_LOGIN_URLS"]
    pattern = re.compile("%s" % "|".join(ignore_check_login_urls))
    if pattern.match(path):
        return True

    pattern = re.compile('%s' % "|".join(ignore_urls))
    if pattern.match(path):
        return True

    return False